package com.deng.common.dao.impl;

import java.sql.Connection;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import com.deng.common.SQLHelper;
import com.deng.common.dao.IShenFen;
import com.deng.common.dao.IXingZhengZhiWu;
import com.deng.common.dao.IZhiChengJiBie;
import com.deng.common.vo.AdminDepartmentVo;
import com.deng.common.vo.ShenFenVo;
import com.deng.common.vo.XingZhengZhiWuVo;
import com.deng.common.vo.ZhiChengJiBieVo;

public class ZhiChengJiBieImpl extends SQLHelper implements IZhiChengJiBie {

	public List<ZhiChengJiBieVo> getAllData() {
		try{
			Connection conn = getConnect();
			
			String sql = "select * from DICT_ZHICHENGJIBIE order by name";
			ResultSet rs = queryData(conn,sql);	
			List<ZhiChengJiBieVo> list = new ArrayList<ZhiChengJiBieVo>();
			while(rs.next()){
				ZhiChengJiBieVo vo = new ZhiChengJiBieVo();
				vo.id = rs.getInt("id");
				vo.name = rs.getString("name");
				vo.fee = rs.getBigDecimal("fee")!=null?rs.getBigDecimal("fee").toString():null;
				vo.point = rs.getBigDecimal("point")!=null?rs.getBigDecimal("point").toString():null;;
				list.add(vo);
			}
			freeConnection(conn);
			return list;
		}catch(Exception ex){
			ex.printStackTrace();
		}
		return null;
	}

}
